{% extends "base_generic.html" %}

{% block title %}
  <title>{{book.title}}</title>
{% endblock %}

{% block content %}
<h1>Title: {{book.title}}</h1>

<p><strong>Author:</strong><a href="{% url 'author-detail' book.author.pk %}">{{book.author}}</a></p>
<p><strong>Summary:</strong>{{book.summary}}</p>
<p><strong>ISBN:</strong>{{book.isbn}}</p>
<p><strong>Language:</strong>{{book.language}}</p>
<p><strong>Genre:</strong>{% for genre in book.genre.all %} {{genre}} {% if not forloop.last %},{% endif %}{% endfor %}</p>

<div style="margin-left:20px;margin-top:20px;">
  <h4>Copies</h4>

  {% for copy in book.bookinstance_set.all %}
  <hr/>
  <p class="{% if copy.status == 'a' %}text-success{% elif copy.status == 'm' %}text-danger{% else %}text-warning{% endif %}">{{copy.get_status_display}}</p>
  <p><strong>Imprint:</strong>{{copy.imprint}}</p>
  <p class="text-muted"><strong>Id:</strong>{{copy.id}}</p>
  {% endfor %}
</div>
{% endblock %}
